﻿@model IEnumerable<MvcApplication9.Models.Ship>

@{
    ViewBag.Title = "Cruises";
}

<link href="@Url.Content("~/ColVis/media/css/ColVis.css")" 
           rel="stylesheet" type="text/css" />   
<link href="@Url.Content("~/media/css/demo_table.css")" 
           rel="stylesheet" type="text/css" />   
<link href="@Url.Content("~/media/css/demo_table_jui.css")" 
           rel="stylesheet" type="text/css" />   

<link href="@Url.Content("~/Content/themes/base/jquery-ui-1.8.4.custom.css")" 
           rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/media/js/jquery.js")" 
           type="text/javascript"></script>
<script src="@Url.Content("~/media/js/jquery.dataTables.js")"
           type="text/javascript"></script>
<script src="@Url.Content("~/ColVis/media/js/ColVis.js")"
           type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $('#example').dataTable({
            "sDom": '<"H"Cfr>t<"F"ip>',
            "bJQueryUI": true,
            "sScrollY": "100%",
            "sScrollX": "100%",
            "bPaginate": true,
            "bLengthChange":true
        });
        
    });
</script>

<h2>Круизы </h2>


@using (Html.BeginForm())
{
    
    <p>Я хочу посетить пункт 
     @Html.DropDownList("filter_points","Любой")
    <input type="submit" value="Фильтровать" />
    </p>   
}

<table id="example">
<thead>

    <tr>
        <th>
            @Html.ActionLink("Имя", "Cruises", new { sorting = "Имя", filter_points = ViewBag.filter_pointsValue })
        </th>
        
        <th>
            @Html.ActionLink("Время", "Cruises", new { sorting = "Время", filter_points = ViewBag.filter_pointsValue  })
        </th>
        <th>
            @Html.ActionLink("Цена", "Cruises", new { sorting = "Цена", filter_points = ViewBag.filter_pointsValue  })
        </th>
        <th>
            Пункты посещения
        </th>
   </tr>
   </thead>
   <tbody>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.ActionLink(item.Course.Title, "CruiseInfo", new { ship_id = item.Id })
        </td>
        <td>
           @item.Survey.ToShortDateString()
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Cost.Payment)
        </td>
        <td>
            @foreach (var course_points in item.Course.CoursePoint)
            {
                
                @Html.DisplayFor(modelItem => course_points.CheckPoint.Title)<br />                
                
            }
        </td>
        
    </tr>
}
</tbody>
</table>



